﻿/// <reference path="Api.js" />
iuPlace.Api.User = {
};

(function () {
    var obj = this;   

    function login(callback) {
    ///	<summary>
    /// Login
    ///	</summary>  
    ///	<param name="callback" type="delegate(iuPlace.Api.Types.DataResult)"/>
        iuPlace.Api.Request("user/login/", true, iuPlace.Api.Session.User, function (dataResult) {
            if (!dataResult.IsError) {
                iuPlace.Api.Session = dataResult.Data;
            }
            if ($.isFunction(callback))
                callback(dataResult);    
        });
    };    
     
    $.extend(iuPlace.Api.User, {
        Login: login
    });
})();